#include <iostream>
#include "com_xuwei_jni_stringoper_StringOper.h"

using namespace std;

JNIEXPORT jstring JNICALL 
Java_com_xuwei_jni_stringoper_StringOper_getLine
(JNIEnv *env, jobject obj, jstring prompt) {
	/* assume the prompt string and user input has less than 128
	characters */
	char outbuf[128], inbuf[128];
	int len = env->GetStringLength(prompt);
	env->GetStringUTFRegion(prompt, 0, len, outbuf);
	int flag = printf("%s", outbuf);
	cout << outbuf << endl;
	cin >> inbuf;
	return env->NewStringUTF(inbuf);
}

